from datetime import datetime, timedelta


def get_date(days):
    """ 输入一个天数，返回和今天的差值"""
    try:
        days = int(days)
    except ValueError:
        raise ValueError("days must be int!")

    if days > 0:
        result = datetime.now() + timedelta(hours=24 * days)
    else:
        result = datetime.now() - timedelta(hours=abs(24 * days))
    return result.strftime("%Y-%m-%d")

if __name__ == '__main__':
    print(get_date('5'))